<template>
  <el-card shadow="always" class="topNavMenu">
    <el-row :gutter="110">
      <el-col :span="1" v-for="nav in topNavMenu">
        <el-tag closable @click="skipRouter(nav.path)" @close="removeTopNavMenu(nav.pid)">
          {{nav.title}}
        </el-tag>
      </el-col>
    </el-row>
  </el-card>
</template>

<script>
    export default {
        name: "TopNavMenu",
        computed:{
            topNavMenu(){
                return this.$store.state.topNavMenu
            }
        },
        methods:{
            removeTopNavMenu(pid){
                this.$store.commit("removeTopNavMenu",pid)
            },
            skipRouter(path){
                this.$router.push(path)
            }
        }
    }
</script>

<style scoped>
    .el-col{
        float: left;
    }

</style>
